// File generated from our OpenAPI spec by Stainless.

package com.metest.api.services.blocking

import com.google.errorprone.annotations.MustBeClosed
import com.metest.api.core.ClientOptions
import com.metest.api.core.RequestOptions
import com.metest.api.core.http.HttpResponse
import com.metest.api.core.http.HttpResponseFor
import com.metest.api.models.user.User
import com.metest.api.models.user.UserCreateParams
import com.metest.api.models.user.UserCreateWithArrayParams
import com.metest.api.models.user.UserCreateWithListParams
import com.metest.api.models.user.UserDeleteParams
import com.metest.api.models.user.UserLoginParams
import com.metest.api.models.user.UserLogoutParams
import com.metest.api.models.user.UserRetrieveParams
import com.metest.api.models.user.UserUpdateParams
import java.util.function.Consumer

interface UserService {

    /**
     * Returns a view of this service that provides access to raw HTTP responses for each method.
     */
    fun withRawResponse(): WithRawResponse

    /**
     * Returns a view of this service with the given option modifications applied.
     *
     * The original service is not modified.
     */
    fun withOptions(modifier: Consumer<ClientOptions.Builder>): UserService

    /** This can only be done by the logged in user. */
    fun create(params: UserCreateParams): User = create(params, RequestOptions.none())

    /** @see create */
    fun create(
        params: UserCreateParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ): User

    /** @see create */
    fun create(user: User, requestOptions: RequestOptions = RequestOptions.none()): User =
        create(UserCreateParams.builder().user(user).build(), requestOptions)

    /** @see create */
    fun create(user: User): User = create(user, RequestOptions.none())

    /** Get user by user name */
    fun retrieve(username: String): User = retrieve(username, UserRetrieveParams.none())

    /** @see retrieve */
    fun retrieve(
        username: String,
        params: UserRetrieveParams = UserRetrieveParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): User = retrieve(params.toBuilder().username(username).build(), requestOptions)

    /** @see retrieve */
    fun retrieve(username: String, params: UserRetrieveParams = UserRetrieveParams.none()): User =
        retrieve(username, params, RequestOptions.none())

    /** @see retrieve */
    fun retrieve(
        params: UserRetrieveParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ): User

    /** @see retrieve */
    fun retrieve(params: UserRetrieveParams): User = retrieve(params, RequestOptions.none())

    /** @see retrieve */
    fun retrieve(username: String, requestOptions: RequestOptions): User =
        retrieve(username, UserRetrieveParams.none(), requestOptions)

    /** This can only be done by the logged in user. */
    fun update(pathUsername: String, params: UserUpdateParams) =
        update(pathUsername, params, RequestOptions.none())

    /** @see update */
    fun update(
        pathUsername: String,
        params: UserUpdateParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ) = update(params.toBuilder().pathUsername(pathUsername).build(), requestOptions)

    /** @see update */
    fun update(params: UserUpdateParams) = update(params, RequestOptions.none())

    /** @see update */
    fun update(params: UserUpdateParams, requestOptions: RequestOptions = RequestOptions.none())

    /** This can only be done by the logged in user. */
    fun delete(username: String) = delete(username, UserDeleteParams.none())

    /** @see delete */
    fun delete(
        username: String,
        params: UserDeleteParams = UserDeleteParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ) = delete(params.toBuilder().username(username).build(), requestOptions)

    /** @see delete */
    fun delete(username: String, params: UserDeleteParams = UserDeleteParams.none()) =
        delete(username, params, RequestOptions.none())

    /** @see delete */
    fun delete(params: UserDeleteParams, requestOptions: RequestOptions = RequestOptions.none())

    /** @see delete */
    fun delete(params: UserDeleteParams) = delete(params, RequestOptions.none())

    /** @see delete */
    fun delete(username: String, requestOptions: RequestOptions) =
        delete(username, UserDeleteParams.none(), requestOptions)

    /** Creates list of users with given input array */
    fun createWithArray(params: UserCreateWithArrayParams) =
        createWithArray(params, RequestOptions.none())

    /** @see createWithArray */
    fun createWithArray(
        params: UserCreateWithArrayParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    )

    /** Creates list of users with given input array */
    fun createWithList(params: UserCreateWithListParams): User =
        createWithList(params, RequestOptions.none())

    /** @see createWithList */
    fun createWithList(
        params: UserCreateWithListParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ): User

    /** Logs user into the system */
    fun login(params: UserLoginParams): String = login(params, RequestOptions.none())

    /** @see login */
    fun login(
        params: UserLoginParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ): String

    /** Logs out current logged in user session */
    fun logout() = logout(UserLogoutParams.none())

    /** @see logout */
    fun logout(
        params: UserLogoutParams = UserLogoutParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    )

    /** @see logout */
    fun logout(params: UserLogoutParams = UserLogoutParams.none()) =
        logout(params, RequestOptions.none())

    /** @see logout */
    fun logout(requestOptions: RequestOptions) = logout(UserLogoutParams.none(), requestOptions)

    /** A view of [UserService] that provides access to raw HTTP responses for each method. */
    interface WithRawResponse {

        /**
         * Returns a view of this service with the given option modifications applied.
         *
         * The original service is not modified.
         */
        fun withOptions(modifier: Consumer<ClientOptions.Builder>): UserService.WithRawResponse

        /**
         * Returns a raw HTTP response for `post /user`, but is otherwise the same as
         * [UserService.create].
         */
        @MustBeClosed
        fun create(params: UserCreateParams): HttpResponseFor<User> =
            create(params, RequestOptions.none())

        /** @see create */
        @MustBeClosed
        fun create(
            params: UserCreateParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<User>

        /** @see create */
        @MustBeClosed
        fun create(
            user: User,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<User> =
            create(UserCreateParams.builder().user(user).build(), requestOptions)

        /** @see create */
        @MustBeClosed
        fun create(user: User): HttpResponseFor<User> = create(user, RequestOptions.none())

        /**
         * Returns a raw HTTP response for `get /user/{username}`, but is otherwise the same as
         * [UserService.retrieve].
         */
        @MustBeClosed
        fun retrieve(username: String): HttpResponseFor<User> =
            retrieve(username, UserRetrieveParams.none())

        /** @see retrieve */
        @MustBeClosed
        fun retrieve(
            username: String,
            params: UserRetrieveParams = UserRetrieveParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<User> =
            retrieve(params.toBuilder().username(username).build(), requestOptions)

        /** @see retrieve */
        @MustBeClosed
        fun retrieve(
            username: String,
            params: UserRetrieveParams = UserRetrieveParams.none(),
        ): HttpResponseFor<User> = retrieve(username, params, RequestOptions.none())

        /** @see retrieve */
        @MustBeClosed
        fun retrieve(
            params: UserRetrieveParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<User>

        /** @see retrieve */
        @MustBeClosed
        fun retrieve(params: UserRetrieveParams): HttpResponseFor<User> =
            retrieve(params, RequestOptions.none())

        /** @see retrieve */
        @MustBeClosed
        fun retrieve(username: String, requestOptions: RequestOptions): HttpResponseFor<User> =
            retrieve(username, UserRetrieveParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `put /user/{username}`, but is otherwise the same as
         * [UserService.update].
         */
        @MustBeClosed
        fun update(pathUsername: String, params: UserUpdateParams): HttpResponse =
            update(pathUsername, params, RequestOptions.none())

        /** @see update */
        @MustBeClosed
        fun update(
            pathUsername: String,
            params: UserUpdateParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponse =
            update(params.toBuilder().pathUsername(pathUsername).build(), requestOptions)

        /** @see update */
        @MustBeClosed
        fun update(params: UserUpdateParams): HttpResponse = update(params, RequestOptions.none())

        /** @see update */
        @MustBeClosed
        fun update(
            params: UserUpdateParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponse

        /**
         * Returns a raw HTTP response for `delete /user/{username}`, but is otherwise the same as
         * [UserService.delete].
         */
        @MustBeClosed
        fun delete(username: String): HttpResponse = delete(username, UserDeleteParams.none())

        /** @see delete */
        @MustBeClosed
        fun delete(
            username: String,
            params: UserDeleteParams = UserDeleteParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponse = delete(params.toBuilder().username(username).build(), requestOptions)

        /** @see delete */
        @MustBeClosed
        fun delete(
            username: String,
            params: UserDeleteParams = UserDeleteParams.none(),
        ): HttpResponse = delete(username, params, RequestOptions.none())

        /** @see delete */
        @MustBeClosed
        fun delete(
            params: UserDeleteParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponse

        /** @see delete */
        @MustBeClosed
        fun delete(params: UserDeleteParams): HttpResponse = delete(params, RequestOptions.none())

        /** @see delete */
        @MustBeClosed
        fun delete(username: String, requestOptions: RequestOptions): HttpResponse =
            delete(username, UserDeleteParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `post /user/createWithArray`, but is otherwise the same
         * as [UserService.createWithArray].
         */
        @MustBeClosed
        fun createWithArray(params: UserCreateWithArrayParams): HttpResponse =
            createWithArray(params, RequestOptions.none())

        /** @see createWithArray */
        @MustBeClosed
        fun createWithArray(
            params: UserCreateWithArrayParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponse

        /**
         * Returns a raw HTTP response for `post /user/createWithList`, but is otherwise the same as
         * [UserService.createWithList].
         */
        @MustBeClosed
        fun createWithList(params: UserCreateWithListParams): HttpResponseFor<User> =
            createWithList(params, RequestOptions.none())

        /** @see createWithList */
        @MustBeClosed
        fun createWithList(
            params: UserCreateWithListParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<User>

        /**
         * Returns a raw HTTP response for `get /user/login`, but is otherwise the same as
         * [UserService.login].
         */
        @MustBeClosed
        fun login(params: UserLoginParams): HttpResponseFor<String> =
            login(params, RequestOptions.none())

        /** @see login */
        @MustBeClosed
        fun login(
            params: UserLoginParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<String>

        /**
         * Returns a raw HTTP response for `get /user/logout`, but is otherwise the same as
         * [UserService.logout].
         */
        @MustBeClosed fun logout(): HttpResponse = logout(UserLogoutParams.none())

        /** @see logout */
        @MustBeClosed
        fun logout(
            params: UserLogoutParams = UserLogoutParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponse

        /** @see logout */
        @MustBeClosed
        fun logout(params: UserLogoutParams = UserLogoutParams.none()): HttpResponse =
            logout(params, RequestOptions.none())

        /** @see logout */
        @MustBeClosed
        fun logout(requestOptions: RequestOptions): HttpResponse =
            logout(UserLogoutParams.none(), requestOptions)
    }
}
